﻿.editor-preview {
    background-color: #f8f8f8;
    overflow: auto;
    position: relative;
}

.container {
    /*position: static !important;*/
    min-width: 390px !important;
}

#card-node {
    height: 75vh !important;
}

    #card-node .fixed-save-contact-row {
        position: sticky !important;
    }

    #card-node .fixed-header {
        position: sticky !important;
    }

.page-footer {
    z-index: 122
}

.editor-preview .footer {
    background-color: #f8f8f8;
    position: fixed;
    height: 200px;
    width: 100%;
    z-index: 12;
}

.content-table > tbody > tr > td {
    vertical-align: middle;
}

.draggable-row:hover {
    background-color: #f1f1f1; /* 滑鼠懸停時改變背景顏色 */
    /*cursor: move;*/ /* 顯示移動光標 */
}

.ImageDel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.4);
    font-size: 30px;
    color: #eee;
    text-shadow: 0 0 2px #333;
    opacity: 0;
    transition: all 0.4s ease-in-out;
    cursor: pointer;
}

.card_info_logo:hover .ImageDel {
    opacity: 1;
}
.click input{
    padding:0px;
    text-align:center;
}
.snapshot-area {
    min-height: 70vh;
}
.draggable-row .download {
    overflow: hidden; /* 超出範圍就隱藏 */
    white-space: nowrap; /* 不換行 */
    text-overflow: ellipsis; /* 顯示 ... */
    max-width: 100px; /* 必須有固定寬度才有效 */
}

/* === 文字區塊展開收合功能（通用於所有模板） === */

/* 限制3行顯示 */
.container .text-block-content.text-clamp-3 {
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 展開狀態 */
.container .text-block-content.text-expanded {
    display: block !important;
}

/* 展開收合按鈕容器 */
.container .text-block-toggle {
    margin-top: 8px;
    text-align: left;
}

/* 展開收合按鈕 */
.container .toggle-button {
    color: #007bff;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.container .toggle-button:hover {
    background-color: #f0f0f0;
    text-decoration: none;
}

/* 展開收合圖示 個人簡述及文字方塊 */
.more-link-icon,
.toggle-button-icon {
    height: 16px;
    width: auto;
    vertical-align: middle;
    display: inline-block;
}

/* Type 9 多階層選單樣式 */
.tree-menu-wrapper,
#card-node .tree-menu-wrapper,
.container .card-field-info .tree-menu-wrapper {
    padding: 8px 0;
    width: 100%;
    font-size: 17px !important;
}

.tree-node-view,
#card-node .tree-node-view {
    margin-bottom: 4px;
    font-size: 1rem;
}

.tree-node-item,
#card-node .tree-node-item {
    display: flex !important;
    align-items: center !important;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
    background-color: transparent;
}

.tree-node-item:hover,
#card-node .tree-node-item:hover {
    background-color: transparent;
}

.tree-node-item.has-children,
#card-node .tree-node-item.has-children {
    cursor: pointer;
}

.tree-node-toggle,
#card-node .tree-node-toggle {
    width: 20px;
    height: 20px;
    min-width: 20px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    flex-shrink: 0;
    margin-right: 6px;
}

.tree-node-toggle:hover,
#card-node .tree-node-toggle:hover {
    color: #333;
}

.tree-node-toggle-placeholder,
#card-node .tree-node-toggle-placeholder {
    width: 20px;
    min-width: 20px;
    display: inline-block;
    flex-shrink: 0;
    margin-right: 6px;
}

.tree-node-text,
#card-node .tree-node-text {
    flex: 1;
    word-break: break-word;
}

.tree-node-link,
#card-node .tree-node-link {
    color: inherit;
    text-decoration: none;
    font-weight: inherit !important;
    font-style: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
}

.tree-node-link:hover,
#card-node .tree-node-link:hover {
    text-decoration: underline;
}

.tree-node-children,
#card-node .tree-node-children {
    margin-left: 20px !important;
    padding-left: 12px !important;
    border-left: none !important;
    margin-top: 4px;
    font-size: 17px !important;
}

/* === 預設圖庫選擇器 Popup 共用樣式 === */

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
}

.popup-source {
    background: #fff;
    border-radius: 8px;
    width: 300px;
    max-width: 90vw;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    overflow: hidden;
}

.popup-source .popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.popup-source .popup-header h6 {
    margin: 0;
    font-weight: 600;
}

.popup-source .popup-body {
    padding: 12px;
    display: flex;
    gap: 8px;
}

.source-btn {
    flex: 1;
    padding: 28px 16px;
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    background: #fafbfc;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.source-btn:hover {
    border-color: #2196F3;
    border-style: solid;
    background: #f0f7ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.15);
}

.source-btn-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e8f0fe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2196F3;
    transition: all 0.2s;
}

.source-btn:hover .source-btn-icon {
    background: #2196F3;
    color: #fff;
}

.source-btn-text {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.popup-library {
    background: #fff;
    border-radius: 8px;
    max-width: 95vw;
    max-height: 85vh;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup-library-icon {
    width: 680px;
}

.popup-library-bg {
    width: 780px;
}

.popup-library .popup-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.popup-library .popup-header .back-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    padding: 4px 8px;
    margin-right: 8px;
    border-radius: 4px;
}

.popup-library .popup-header .back-btn:hover {
    background: #f0f0f0;
}

.popup-library .popup-header h6 {
    margin: 0;
    font-weight: 600;
}

.category-tabs {
    display: flex;
    padding: 0 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.category-tab {
    padding: 8px 14px;
    cursor: pointer;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.category-tab:hover {
    color: #333;
}

.category-tab.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
}

.style-tabs {
    display: flex;
    padding: 10px 16px 0;
    gap: 6px;
    flex-shrink: 0;
}

.style-tab {
    padding: 5px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 13px;
    background: #f0f0f0;
    color: #666;
    transition: all 0.2s;
    border: none;
}

.style-tab:hover {
    background: #e0e0e0;
}

.style-tab.active {
    background: #2196F3;
    color: #fff;
}

.popup-footer {
    padding: 10px 16px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.popup-footer .selected-preview {
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-footer .selected-preview img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-close-popup {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close-popup:hover {
    color: #333;
}

/* Icon 圖庫專用 */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
}

.icon-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: 2px solid transparent;
    overflow: hidden;
}

.icon-item:hover {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.icon-item.selected {
    background: #e3f2fd;
    border-color: #2196F3;
}

.icon-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* 背景圖庫專用 */
.bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 10px 16px 16px;
    overflow-y: auto;
    flex: 1;
}

.bg-item {
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    border: 3px solid transparent;
    overflow: hidden;
    position: relative;
}

.bg-item:hover {
    border-color: #e0e0e0;
}

.bg-item.selected {
    border-color: #2196F3;
}

.bg-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}
